package com.bosssoft.cloud.wechat.core.bean.msg.dto;

import com.alibaba.fastjson.annotation.JSONField;
import com.bosssoft.cloud.wechat.core.bean.WxBaseMsg;
import com.bosssoft.cloud.wechat.infrastructure.constant.WxKeywordConsts;
import com.bosssoft.cloud.wechat.infrastructure.annotation.XmlRoot;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * 回复音乐消息
 *
 * @author wcy create on 2021/5/27 17:04 下午
 */
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@XmlRoot
public class MusicDTO extends WxBaseMsg {
    @JSONField(name = "Music")
    private MediaVO mediaVO;

    public MusicDTO(String toUserName, String fromUserName, MediaVO mediaVO) {
        super(toUserName, fromUserName, String.valueOf(System.currentTimeMillis() / 1000), WxKeywordConsts.MsgType.MUSIC);
        this.mediaVO = mediaVO;
    }

    @Data
    public static class MediaVO {
        /**
         * 音乐标题
         */
        @JSONField(name = "Title")
        private String title;
        /**
         * 音乐描述
         */
        @JSONField(name = "Description")
        private String description;
        /**
         * 音乐链接
         */
        @JSONField(name = "MusicURL")
        private String musicURL;
        /**
         * 高质量音乐链接，WIFI环境优先使用该链接播放音乐
         */
        @JSONField(name = "HQMusicUrl")
        private String hQMusicUrl;
        /**
         * 缩略图的媒体id，通过素材管理中的接口上传多媒体文件，得到的id
         */
        @JSONField(name = "ThumbMediaId")
        private String thumbMediaId;
    }


}
